<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------

namespace Home\Controller;

/**
 * 前台首页控制器
 * 品牌
 */
class BrandController extends HomeController {

	//系统首页
    public function index(){
        $id= I("id",0,'intval');
        $brand = D("Brand")->limit(4)->field("id,bname,pic")->select();
        $this->assign("brand",$brand);
        if(empty($id)){
            $id=$brand[0]["id"];
        }
        $where["id"] = array("eq",$id);
        $info =D("Brand")->where($where)->field("bpic,content")->find();
        $this->assign("info",$info);
        $this->display();
    }

}